package com.tiancheng.trade.order.mapper;


import com.tiancheng.trade.order.model.Coupon;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 优惠券持久化接口
 *
 * @author kellen
 * @date 2024-03-02
 */
@Repository
public interface CouponMapper extends TYBaseMapper<Coupon> {

    /**
     * 批量保存优惠券记录
     *
     * @param coupons
     * @return
     */
    int saveBatch(List<Coupon> coupons);

    /**
     * 按主订单编号查询优惠券信息
     *
     * @param orderIds
     * @return
     */
    List<Coupon> getCouponByOrderId(@Param("list") List<String> orderIds);

}